#ifndef _FileCheck_COMMON_H
#define _FileCheck_COMMON_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


#include <shlwapi.h>

#define MAX_FILE_DATE	20
#define MAX_FILESIZE	32

#include <vector>
using namespace std;

typedef enum
{
	STATUS_UNUSED,
	STATUS_USED,
	STATUS_FININISHED
}EnumUsedStatus;


typedef enum
{
	DOC_TYPE_UNKNOWN = 0,
	DOC_TYPE_WORD,
	DOC_TYPE_EXCEL
}EnumDocType;

typedef struct {
	EnumUsedStatus  eUsedStatus; // for multiple-thread
	int				nItemIndex; // item index for update list view
	TCHAR 			szFilePath[MAX_PATH];			// File full path
	TCHAR 			szFileName[FILENAME_MAX];		// File name
	EnumDocType		eDocType; // Doc type

	HWND 			hProgress1; // For whole progress, workbook
	HWND 			hProgress2; // For one sheet progress
	CString 		strErr; // Save the error message
}FileInfo_t;

typedef vector<FileInfo_t*> FILEINFOLST, *LPFILEINFOLST;
typedef FILEINFOLST::iterator FILEINFO_ITERATOR;

// release vector
void InitFileInfo(FileInfo_t* pstFileInfo);
void ReleaseList(FILEINFOLST& vecLst);
void GetErrMsg(FILEINFOLST& vecLst, CString& strErr);

void ResetUnused(FILEINFOLST& vecLst);
FileInfo_t* GetNextUnused(FILEINFOLST& vecLst);
BOOL IsAllFinished(FILEINFOLST& vecLst);

//
// List control
//
typedef enum
{
	LC_FILE_NAME = 1,
	LC_PROGRESS_WHOLE,
	LC_PROGRESS_SHEET,
	LC_CHECK_RESULT,
	LC_ITEM_MAX
}EnumColumn;

//
// Function definitions
//
BOOL PathExists(LPCTSTR pszPath);
long CreateFolders(LPCTSTR pcszPath);

#endif
